<script setup>
import {useUserStore} from "../stores/user.js";
import {ref} from "vue";

const userStore = useUserStore();
console.log(userStore.username);
const userName = ref(userStore.username);
userStore.updateUser('Alice');
console.log(userStore.username);
</script>

<template>
  <div>
    <nav>
    <h2>我的名字：{{userName}}</h2>
    <router-link to="/todo">我的待办 |</router-link>
    <router-link to="/post/1?keyword=blog"> 我的博客 |</router-link>
    </nav>
    <router-view></router-view>
  </div>

</template>

<style scoped>

</style>